﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NT.SharePoint.RS.WebParts.BO
{
    public class RSParameter
    {
        public string Name { get; set; }

        /// <summary>
        /// Values stored as string separated by semi comma
        /// </summary>
        private string values;
        public string Values
        {
            set
            {
                this.values = value;
            }
        }

        public bool Connected { get; set; }
        public bool MultipleValue { get; set; }

        private Dictionary<string, RSParameterValidValue> validValues = new Dictionary<string, RSParameterValidValue>();
        public Dictionary<string, RSParameterValidValue> ValidValues
        {
            get
            {
                return this.validValues;
            }
        }

        public class RSParameterValidValue
        {
            public string Value { get; set; }
            public string Label { get; set; }
        }

        public string GetValue()
        {
            return this.values.Split(';')[0];
        }

        public List<string> GetValues()
        {
            return new List<string>(this.values.Split(';'));
        }
    }
}
